﻿namespace HRM.CORE
{

    using APP.HELPER.Data.Helper;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;

    public class HRM_PAYINSURANCE_C68AHD
    {
        private Guid m_C68aHDID;
        private string m_Condition;
        private string m_Description;
        private string m_EmployeeCode;
        private string m_EmployeeName;
        private DateTime m_FromDate;
        private int m_HomeAbsent;
        private decimal m_Money;
        private Guid m_PayInsuranceTableListID;
        private int m_ProgressAbsent;
        private int m_PublicAbsent;
        private string m_SocialInsuranceCode;
        private string m_Time;
        private DateTime m_ToDate;

        public HRM_PAYINSURANCE_C68AHD()
        {
            this.m_C68aHDID = Guid.Empty;
            this.m_PayInsuranceTableListID = Guid.Empty;
            this.m_EmployeeCode = "";
            this.m_EmployeeName = "";
            this.m_SocialInsuranceCode = "";
            this.m_Condition = "";
            this.m_Time = "";
            this.m_ProgressAbsent = 0;
            this.m_HomeAbsent = 0;
            this.m_PublicAbsent = 0;
            this.m_Money = 0M;
            this.m_FromDate = DateTime.Now;
            this.m_ToDate = DateTime.Now;
            this.m_Description = "";
        }

        public HRM_PAYINSURANCE_C68AHD(Guid C68aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, string Time, int ProgressAbsent, int HomeAbsent, int PublicAbsent, decimal Money, DateTime FromDate, DateTime ToDate, string Description)
        {
            this.m_C68aHDID = C68aHDID;
            this.m_PayInsuranceTableListID = PayInsuranceTableListID;
            this.m_EmployeeCode = EmployeeCode;
            this.m_EmployeeName = EmployeeName;
            this.m_SocialInsuranceCode = SocialInsuranceCode;
            this.m_Condition = Condition;
            this.m_Time = Time;
            this.m_ProgressAbsent = ProgressAbsent;
            this.m_HomeAbsent = HomeAbsent;
            this.m_PublicAbsent = PublicAbsent;
            this.m_Money = Money;
            this.m_FromDate = FromDate;
            this.m_ToDate = ToDate;
            this.m_Description = Description;
        }

        public string Delete()
        {
            string[] myParams = new string[] { "@C68aHDID" };
            object[] myValues = new object[] { this.m_C68aHDID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C68AHD_Delete", myParams, myValues);
        }

        public string Delete(Guid C68aHDID)
        {
            string[] myParams = new string[] { "@C68aHDID" };
            object[] myValues = new object[] { C68aHDID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C68AHD_Delete", myParams, myValues);
        }

        public string Delete(SqlConnection myConnection, Guid C68aHDID)
        {
            string[] myParams = new string[] { "@C68aHDID" };
            object[] myValues = new object[] { C68aHDID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_PAYINSURANCE_C68AHD_Delete", myParams, myValues);
        }

        public string Delete(SqlTransaction myTransaction, Guid C68aHDID)
        {
            string[] myParams = new string[] { "@C68aHDID" };
            object[] myValues = new object[] { C68aHDID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PAYINSURANCE_C68AHD_Delete", myParams, myValues);
        }

        public bool Exist(Guid C68aHDID)
        {
            bool hasRows = false;
            string[] myParams = new string[] { "@C68aHDID" };
            object[] myValues = new object[] { C68aHDID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader("HRM_PAYINSURANCE_C68AHD_Get", myParams, myValues);
            if (reader != null)
            {
                hasRows = reader.HasRows;
                reader.Close();
                helper.Close();
                reader = null;
            }
            return hasRows;
        }

        public string Get(Guid C68aHDID)
        {
            string str = "";
            string[] myParams = new string[] { "@C68aHDID" };
            object[] myValues = new object[] { C68aHDID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader("HRM_PAYINSURANCE_C68AHD_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_C68aHDID = reader.GetGuid(reader.GetOrdinal("C68aHDID"));
                    this.m_PayInsuranceTableListID = reader.GetGuid(reader.GetOrdinal("PayInsuranceTableListID"));
                    this.m_EmployeeCode = Convert.ToString(reader["EmployeeCode"]);
                    this.m_EmployeeName = Convert.ToString(reader["EmployeeName"]);
                    this.m_SocialInsuranceCode = Convert.ToString(reader["SocialInsuranceCode"]);
                    this.m_Condition = Convert.ToString(reader["Condition"]);
                    this.m_Time = Convert.ToString(reader["Time"]);
                    this.m_ProgressAbsent = Convert.ToInt32(reader["ProgressAbsent"]);
                    this.m_HomeAbsent = Convert.ToInt32(reader["HomeAbsent"]);
                    this.m_PublicAbsent = Convert.ToInt32(reader["PublicAbsent"]);
                    this.m_Money = Convert.ToDecimal(reader["Money"]);
                    this.m_FromDate = Convert.ToDateTime(reader["FromDate"]);
                    this.m_ToDate = Convert.ToDateTime(reader["ToDate"]);
                    this.m_Description = Convert.ToString(reader["Description"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public string Get(SqlConnection myConnection, Guid C68aHDID)
        {
            string str = "";
            string[] myParams = new string[] { "@C68aHDID" };
            object[] myValues = new object[] { C68aHDID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader(myConnection, "HRM_PAYINSURANCE_C68AHD_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_C68aHDID = reader.GetGuid(reader.GetOrdinal("C68aHDID"));
                    this.m_PayInsuranceTableListID = reader.GetGuid(reader.GetOrdinal("PayInsuranceTableListID"));
                    this.m_EmployeeCode = Convert.ToString(reader["EmployeeCode"]);
                    this.m_EmployeeName = Convert.ToString(reader["EmployeeName"]);
                    this.m_SocialInsuranceCode = Convert.ToString(reader["SocialInsuranceCode"]);
                    this.m_Condition = Convert.ToString(reader["Condition"]);
                    this.m_Time = Convert.ToString(reader["Time"]);
                    this.m_ProgressAbsent = Convert.ToInt32(reader["ProgressAbsent"]);
                    this.m_HomeAbsent = Convert.ToInt32(reader["HomeAbsent"]);
                    this.m_PublicAbsent = Convert.ToInt32(reader["PublicAbsent"]);
                    this.m_Money = Convert.ToDecimal(reader["Money"]);
                    this.m_FromDate = Convert.ToDateTime(reader["FromDate"]);
                    this.m_ToDate = Convert.ToDateTime(reader["ToDate"]);
                    this.m_Description = Convert.ToString(reader["Description"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public string Get(SqlTransaction myTransaction, Guid C68aHDID)
        {
            string str = "";
            string[] myParams = new string[] { "@C68aHDID" };
            object[] myValues = new object[] { C68aHDID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader(myTransaction, "HRM_PAYINSURANCE_C68AHD_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_C68aHDID = reader.GetGuid(reader.GetOrdinal("C68aHDID"));
                    this.m_PayInsuranceTableListID = reader.GetGuid(reader.GetOrdinal("PayInsuranceTableListID"));
                    this.m_EmployeeCode = Convert.ToString(reader["EmployeeCode"]);
                    this.m_EmployeeName = Convert.ToString(reader["EmployeeName"]);
                    this.m_SocialInsuranceCode = Convert.ToString(reader["SocialInsuranceCode"]);
                    this.m_Condition = Convert.ToString(reader["Condition"]);
                    this.m_Time = Convert.ToString(reader["Time"]);
                    this.m_ProgressAbsent = Convert.ToInt32(reader["ProgressAbsent"]);
                    this.m_HomeAbsent = Convert.ToInt32(reader["HomeAbsent"]);
                    this.m_PublicAbsent = Convert.ToInt32(reader["PublicAbsent"]);
                    this.m_Money = Convert.ToDecimal(reader["Money"]);
                    this.m_FromDate = Convert.ToDateTime(reader["FromDate"]);
                    this.m_ToDate = Convert.ToDateTime(reader["ToDate"]);
                    this.m_Description = Convert.ToString(reader["Description"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public DataTable GetList()
        {
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_PAYINSURANCE_C68AHD_GetList");
        }

        public DataTable GetList(Guid PayInsuranceTableListID)
        {
            string[] myParams = new string[] { "@PayInsuranceTableListID" };
            object[] myValues = new object[] { PayInsuranceTableListID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_PAYINSURANCE_C68AHD_GetListByPayInsuranceTableList", myParams, myValues);
        }

        public string Insert()
        {
            string[] myParams = new string[] { "@C68aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Time", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@FromDate", "@ToDate", "@Description" };
            object[] myValues = new object[] { this.m_C68aHDID, this.m_PayInsuranceTableListID, this.m_EmployeeCode, this.m_EmployeeName, this.m_SocialInsuranceCode, this.m_Condition, this.m_Time, this.m_ProgressAbsent, this.m_HomeAbsent, this.m_PublicAbsent, this.m_Money, this.m_FromDate, this.m_ToDate, this.m_Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C68AHD_Insert", myParams, myValues);
        }

        public string Insert(SqlTransaction myTransaction)
        {
            string[] myParams = new string[] { "@C68aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Time", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@FromDate", "@ToDate", "@Description" };
            object[] myValues = new object[] { this.m_C68aHDID, this.m_PayInsuranceTableListID, this.m_EmployeeCode, this.m_EmployeeName, this.m_SocialInsuranceCode, this.m_Condition, this.m_Time, this.m_ProgressAbsent, this.m_HomeAbsent, this.m_PublicAbsent, this.m_Money, this.m_FromDate, this.m_ToDate, this.m_Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PAYINSURANCE_C68AHD_Insert", myParams, myValues);
        }

        public string Insert(Guid C68aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, string Time, int ProgressAbsent, int HomeAbsent, int PublicAbsent, decimal Money, DateTime FromDate, DateTime ToDate, string Description)
        {
            string[] myParams = new string[] { "@C68aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Time", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@FromDate", "@ToDate", "@Description" };
            object[] myValues = new object[] { C68aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, Time, ProgressAbsent, HomeAbsent, PublicAbsent, Money, FromDate, ToDate, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C68AHD_Insert", myParams, myValues);
        }

        public string Insert(SqlConnection myConnection, Guid C68aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, string Time, int ProgressAbsent, int HomeAbsent, int PublicAbsent, decimal Money, DateTime FromDate, DateTime ToDate, string Description)
        {
            string[] myParams = new string[] { "@C68aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Time", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@FromDate", "@ToDate", "@Description" };
            object[] myValues = new object[] { C68aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, Time, ProgressAbsent, HomeAbsent, PublicAbsent, Money, FromDate, ToDate, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_PAYINSURANCE_C68AHD_Insert", myParams, myValues);
        }

        public string Insert(SqlTransaction myTransaction, Guid C68aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, string Time, int ProgressAbsent, int HomeAbsent, int PublicAbsent, decimal Money, DateTime FromDate, DateTime ToDate, string Description)
        {
            string[] myParams = new string[] { "@C68aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Time", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@FromDate", "@ToDate", "@Description" };
            object[] myValues = new object[] { C68aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, Time, ProgressAbsent, HomeAbsent, PublicAbsent, Money, FromDate, ToDate, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PAYINSURANCE_C68AHD_Insert", myParams, myValues);
        }

        public string NewID()
        {
            return SqlHelper.GenCode("HRM_PAYINSURANCE_C68AHD", "C68aHDID", "CV");
        }

        public string Update()
        {
            string[] myParams = new string[] { "@C68aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Time", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@FromDate", "@ToDate", "@Description" };
            object[] myValues = new object[] { this.m_C68aHDID, this.m_PayInsuranceTableListID, this.m_EmployeeCode, this.m_EmployeeName, this.m_SocialInsuranceCode, this.m_Condition, this.m_Time, this.m_ProgressAbsent, this.m_HomeAbsent, this.m_PublicAbsent, this.m_Money, this.m_FromDate, this.m_ToDate, this.m_Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C68AHD_Update", myParams, myValues);
        }

        public string Update(Guid C68aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, string Time, int ProgressAbsent, int HomeAbsent, int PublicAbsent, decimal Money, DateTime FromDate, DateTime ToDate, string Description)
        {
            string[] myParams = new string[] { "@C68aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Time", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@FromDate", "@ToDate", "@Description" };
            object[] myValues = new object[] { C68aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, Time, ProgressAbsent, HomeAbsent, PublicAbsent, Money, FromDate, ToDate, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C68AHD_Update", myParams, myValues);
        }

        public string Update(SqlConnection myConnection, Guid C68aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, string Time, int ProgressAbsent, int HomeAbsent, int PublicAbsent, decimal Money, DateTime FromDate, DateTime ToDate, string Description)
        {
            string[] myParams = new string[] { "@C68aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Time", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@FromDate", "@ToDate", "@Description" };
            object[] myValues = new object[] { C68aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, Time, ProgressAbsent, HomeAbsent, PublicAbsent, Money, FromDate, ToDate, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_PAYINSURANCE_C68AHD_Update", myParams, myValues);
        }

        public string Update(SqlTransaction myTransaction, Guid C68aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, string Time, int ProgressAbsent, int HomeAbsent, int PublicAbsent, decimal Money, DateTime FromDate, DateTime ToDate, string Description)
        {
            string[] myParams = new string[] { "@C68aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Time", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@FromDate", "@ToDate", "@Description" };
            object[] myValues = new object[] { C68aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, Time, ProgressAbsent, HomeAbsent, PublicAbsent, Money, FromDate, ToDate, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PAYINSURANCE_C68AHD_Update", myParams, myValues);
        }

        [Category("Primary Key"), DisplayName("C68aHDID")]
        public Guid C68aHDID
        {
            get
            {
                return this.m_C68aHDID;
            }
            set
            {
                this.m_C68aHDID = value;
            }
        }

        [Category("Column"), DisplayName("Condition")]
        public string Condition
        {
            get
            {
                return this.m_Condition;
            }
            set
            {
                this.m_Condition = value;
            }
        }

        [Category("Column"), DisplayName("Description")]
        public string Description
        {
            get
            {
                return this.m_Description;
            }
            set
            {
                this.m_Description = value;
            }
        }

        [Category("Column"), DisplayName("EmployeeCode")]
        public string EmployeeCode
        {
            get
            {
                return this.m_EmployeeCode;
            }
            set
            {
                this.m_EmployeeCode = value;
            }
        }

        [Category("Column"), DisplayName("EmployeeName")]
        public string EmployeeName
        {
            get
            {
                return this.m_EmployeeName;
            }
            set
            {
                this.m_EmployeeName = value;
            }
        }

        [DisplayName("FromDate"), Category("Column")]
        public DateTime FromDate
        {
            get
            {
                return this.m_FromDate;
            }
            set
            {
                this.m_FromDate = value;
            }
        }

        [Category("Column"), DisplayName("HomeAbsent")]
        public int HomeAbsent
        {
            get
            {
                return this.m_HomeAbsent;
            }
            set
            {
                this.m_HomeAbsent = value;
            }
        }

        [Category("Column"), DisplayName("Money")]
        public decimal Money
        {
            get
            {
                return this.m_Money;
            }
            set
            {
                this.m_Money = value;
            }
        }

        [Category("Column"), DisplayName("PayInsuranceTableListID")]
        public Guid PayInsuranceTableListID
        {
            get
            {
                return this.m_PayInsuranceTableListID;
            }
            set
            {
                this.m_PayInsuranceTableListID = value;
            }
        }

        public string ProductName
        {
            get
            {
                return "Class HRM_PAYINSURANCE_C68AHD";
            }
        }

        public string ProductVersion
        {
            get
            {
                return "1.0.0.0";
            }
        }

        [DisplayName("ProgressAbsent"), Category("Column")]
        public int ProgressAbsent
        {
            get
            {
                return this.m_ProgressAbsent;
            }
            set
            {
                this.m_ProgressAbsent = value;
            }
        }

        [DisplayName("PublicAbsent"), Category("Column")]
        public int PublicAbsent
        {
            get
            {
                return this.m_PublicAbsent;
            }
            set
            {
                this.m_PublicAbsent = value;
            }
        }

        [Category("Column"), DisplayName("SocialInsuranceCode")]
        public string SocialInsuranceCode
        {
            get
            {
                return this.m_SocialInsuranceCode;
            }
            set
            {
                this.m_SocialInsuranceCode = value;
            }
        }

        [Category("Column"), DisplayName("Time")]
        public string Time
        {
            get
            {
                return this.m_Time;
            }
            set
            {
                this.m_Time = value;
            }
        }

        [Category("Column"), DisplayName("ToDate")]
        public DateTime ToDate
        {
            get
            {
                return this.m_ToDate;
            }
            set
            {
                this.m_ToDate = value;
            }
        }
    }
}

